const useCommodityStore = defineStore(
  // 唯一ID
  'NewPageCache', () => {
    const cacheData: { [key: string]: any } = {
      // 图标管理
      icon: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Display: '~',
          IconClass: '~',
          IconType: '1',
        },
      },
      // 弹幕管理
      barrageManagement: {
        currentPage: 1,
        currentSize: 20,
      },
      // 商品管理
      MerchandiseControl: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          BrandId: '~',
          IsActive: true,
          productName: '',
          productId: '',
          storeSelect: '',
          classifySelect: '',
          flag: '~',
        },
      },
      // 福卡活动
      fukaact: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Flag: 1,
        },
      },
      // 任选活动
      renxuan: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Title: '',
          ActStatus: '~',
        },
      },
      // 任选活动-关联商品
      renxuanProduct: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          ProductId: '',
          Enable: '~',
        },
      },
      // 团购活动-团长
      tuangouTuanleader: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Name: '',
        },
      },
      // 团购活动-团购信息
      tuangouTuan: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          TuanLeaderId: '',
          ProductId: '',
          TuanTitle: '',
          Enable: '~',
        },
      },
      // 团购活动-团购信息-浏览记录
      tuangouTuanView: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          TuanInfoId: '',
          UserId: '',
        },
      },
      // 团购活动-跟团订单
      tuangouTuanOrder: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          TuanLeaderId: '',
          TuanLeaderName: '',
          TuanTitle: '',
          ProductId: '',
          ProductName: '',
          OrderNo: '',
          UserId: '',
        },
      },
      // 团购活动-团购评价
      tuangouTuanEvaluation: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          TuanLeaderId: '',
          TuanLeaderName: '',
          TuanTitle: '',
          ProductId: '',
          UserId: '',
          Contents: '',
          AuditStatus: '~',
          AuditReason: '',
        },
      },
      // 团购活动-跟团评价点赞分页列表
      tuanEvaluationPraise: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          TuanEvaluationId: '',
        },
      },
      // 人员管理
      account: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          RecShopId: '~',
          RecShopName: '',
          Id: '',
          UserId: '',
          RealName: '',
          UserMobile: '',
          RoleId: '~',
          ParentId: '',
          ParentUserId: '',
          ParentRealName: '',
          ParentUserMobile: '',
        },
      },
      // 业绩
      RetailOrderYeji: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          orderStatus: '1',
          TimeWd: '1',
          YejiTime: [],
          SPYejiTime: [],
          TagList: [],
        },
      },
      // 签到活动任务配置
      signintask: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          TaskType: '~',
          TaskStatus: '~',
          Title: '',
        },
      },
      // 签到活动邀请记录
      signintaskInvated: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Openid: '',
          ShareUserid: '',
          ShareOpenid: '',
        },
      },
      // 签到活动邀请记录
      signintaskSentcoupon: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          OpenId: '',
          UserId: '',
          TicketId: '',
          Title: '',
          SignDays: '',
        },
      },
      // 拼团记录
      pintuan: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          UserId: '',
          OrderNo: '',
          ProductId: '',
          Flag: '~',
          AddTime: [],
        },
      },
      // 援疆会员
      yuanjiang: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Id: '',
          UserId: '',
          Mobile: '',
          ParentId: '',
          ParentUserId: '',
          RoleId: '~',
          Status: '~',
        },
      },
      // 0元试用-商品管理
      freetrial: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Title: '',
          Enable: '~',
          status: '~',
        },
      },
      // 会员日
      memberholiday: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Name: '',
          ProductIdsSec: [],
          ProductIdsNom: [],
        },
      },
      // 客户端账号
      clientAdminAccount: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Username: '',
          Mobile: '',
          RoleId: '~',
          Realname: '',
          Nickname: '',
          IsExpired: '',
          AccountState: '~',
          StoreId: '~',
          OpenId: '',
        },
      },
      // 送面膜活动-活动用户
      givefacialmaskactUser: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          ActMianmoId: '',
          UserId: '',
        },
      },
      // 送面膜活动-活动用户
      drawact: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          ActStatus: '',
        },
      },
      // 测肤记录
      skincheck: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          UserId: '',
          UserPhone: '',
          Source: '',
          RecStatus: '~',
          AddTIme: [],
        },
      },
      // 测肤记录-测肤券
      skincheckTicketList: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          TicketId: '',
          SkinKey: '~',
          Status: '~',
        },
      },
      // 测肤记录-发券记录
      skincheckTicketSentList: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          UserId: '',
          UserPhone: '',
          TicketId: '',
          SkinCheckId: '',
          SkinKey: '~',
        },
      },
      // 测肤记录-连连看发券记录
      skincheckTicketLlksentList: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          UserId: '',
          UserPhone: '',
          TicketId: '',
          Source: '~',
        },
      },
      // 代金券
      voucher: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Id: '',
          TicketName: '',
          Type: '~',
          Flag: '~',
        },
      },
      // 系统分享配置
      sysshareconfig: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          ActId: '~',
        },
      },
      // 小程序用户
      subscriber: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          UserId: '',
          SCOpenId: '',
          UserPhone: '',
          UserNickName: '',
        },
      },
      // 运费险-退货申请记录
      aftersalesApply: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          OrderNo: '',
          IsRefuse: '~',
          ApplyStatus: '~',
          WaybillId: '',
          DeliveryName: '',
        },
      },
      // 运费险-保单记录
      aftersalesPolicyrecord: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          OrderNo: '',
          PolicyNo: '',
          PolicyStatus: '~',
          IsHomePickUp: '~',
        },
      },
      // 运费险-理赔记录
      aftersalesClaimrecord: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          OrderNo: '',
          RefundDeliveryNo: '',
        },
      },
      // 会员明细
      membership: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          UserId: '',
          Mobile: '',
          VipLevel: '',
          Time: [],
        },
      },
      // 广告机兑换码记录
      screenCodeList: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          ExCode: '',
          Status: '~',
          UserId: '',
          UserPhone: '',
          Time: [],
        },
      },
      // 广告机分配日志
      screenLogList: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          ExCode: '',
          UserId: '',
          UserPhone: '',
        },
      },
      // 广告机分配日志
      screenActList: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Status: '~',
        },
      },
      // 品牌官-人员列表
      brandofficial: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          Id: '',
          UserId: '',
          RealName: '',
          UserMobile: '',
          UserStatus: '~',
        },
      },
      // 品牌官-分润记录
      brandofficialFenrunList: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          OutOrderNo: '',
          WxOrderId: '',
          UserId: '',
          UserMobile: '',
          SCOpenId: '',
          Flag: '~',
          FenRunTime: [],
        },
      },
      // 品牌官-分润明细
      brandofficialFenrunDetail: {
        currentPage: 1,
        currentSize: 20,
      },
      // 品牌官-裂变券
      brandofficialTicket: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          TicketId: '',
          Status: '~',
        },
      },
      // 商品转发素材配置
      productshare: {
        currentPage: 1,
        currentSize: 20,
        fromData: {
          ProductId: '',
          ShareType: '~',
        },
      },
    }
    function GetCacheData(key: string) {
      // 返回信息
      return cacheData[key]
    }
    function SetCacheData(key: string, page: number, size: number, fromData?: any) {
      if (page && size) {
        cacheData[key].currentPage = page
        cacheData[key].currentSize = size
      }
      if (fromData) {
        cacheData[key].fromData = fromData
      }
    }
    return {
      GetCacheData,
      SetCacheData,
    }
  },
)
export default useCommodityStore
